package cn.tedu.spring.eg3;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class ShopController {
    private String shopController;

    public ShopController() {
        System.out.println("1.生命周期实例化阶段");
    }

    @Value("XX商城")
    public void setShopController(String shopController) {
        this.shopController = shopController;
        System.out.println("2.生命周期属性赋值");
    }

    @PostConstruct
    public void init(){
        System.out.println("3.生命周期初始化阶段");
    }

    @PreDestroy
    public void destory(){
        System.out.println("5.生命周期销毁阶段");
    }
}
